package com.shensi.api.pay.client;

import com.shensi.api.pay.pojo.WxAppInfo;
import com.shensi.api.pay.pojo.WxCardInfoParm;
import com.shensi.common.core.constant.CloudConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/*
 * <Title> WeiXinCardController </Title>
 * <Description> 微信卡券 </Description>
 * @Date 2021年12月3日
 */
@Api(tags = "微信卡券")
@FeignClient(name = CloudConstant.SHENSI_APP_COOLECT)
public interface WeiXinCardClient {


    /**
     * 手动清除缓存accesToken
     *
     * @return
     */
    @GetMapping("/delAccessTokenToRedis")
    String delAccessTokenToRedis(@RequestParam("appId") String appId);


    /**
     * SaaS系统获取accessToken
     *
     * @return
     */
    @ApiOperation(value = "SaaS系统获取accessToken")
    @PostMapping("/getAccessTokenFromSaas")
    String getAccessTokenFromSaas(@RequestBody WxAppInfo wxAppInfo);

    /**
     * 微信卡券获取地址url
     *
     * @param enterpriseId
     * @param outStr
     * @return
     */
    @GetMapping("/getCardUrl")
    @ApiOperation(value = "获取微信卡券网址")
    String getCardUrl(@RequestParam("enterpriseId") Integer enterpriseId, @RequestParam("outStr") String outStr, @RequestParam("openId") String openId, @RequestParam(value = "shareUserId",required = false)Integer shareUserId);

    /***
     * 根据微信卡券ID查询油企信息
     * @param cardId
     * @return
     */
    @GetMapping("/selectEnterpriseIdByCardId")
    @ApiOperation(value = "根据微信cardId 获取油企信息")
    String selectEnterpriseIdByCardId(@RequestParam("cardId") String cardId);


    /**
     * 获取卡手机号
     *
     * @param wcp
     * @return
     */
    @PostMapping("/selectCardMobilePhone")
    @ApiOperation(value = "获取微信卡券手机号")
    String selectCardMobilePhone(@RequestBody WxCardInfoParm wcp);

    /************************************************************************************************************************************************************************************************************
     * 根据微信卡券获取微信卡券用户信息:   此方法作用备注：公众号用户卡券直接激活；
     * @param wcp
     * @return
     **********************************************************************************************************************************************************************************************************/
    @PostMapping("/selectWxMemberCardInfo")
    @ApiOperation(value = "获取微信卡券用户信息")
    String selectWxMemberCardInfo(@RequestBody WxCardInfoParm wcp);




}

